package com.general.framework.service.impl;

import com.general.framework.mapper.MenuMapper;
import com.general.framework.mapper.UserRoleMapper;
import com.general.framework.service.PermissionService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class PermissionServiceImpl implements PermissionService {

    @Autowired
    private MenuMapper menuMapper;
    @Autowired
    private UserRoleMapper userRoleMapper;

    @Override
    public List<String> getPermissionsByUserId(Long userId) {
        return menuMapper.getPermissionsByUserId(userId);
    }

    @Override
    public List<String> getRolesByUserId(Long userId) {
        return userRoleMapper.getRolesByUserId(userId);
    }
}